type AnimationType = 'slide-in-right' | 'pop-in' | 'zoom-in' | 'fade-in'

/**
 * 带动画效果的页面跳转
 */
export const navigateWithAnimation = (url: string, animationType: AnimationType = 'slide-in-right') => {
  return new Promise((resolve, reject) => {
    uni.navigateTo({
      url,
      animationType,
      animationDuration: 300,
      success: resolve,
      fail: reject
    })
  })
}

/**
 * 带动画效果的返回
 */
export const navigateBackWithAnimation = () => {
  uni.navigateBack({
    delta: 1,
    animationType: 'pop-out',
    animationDuration: 300
  })
} 